import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/userDesktop',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/userDesktop/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/userDesktop',
    method: 'put',
    data
  })
}

// 审批通过
export function userDesktopPass(data) {
  return request({
    url: 'api/userDesktop/pass',
    method: 'post',
    data
  })
}

// 审批不通过
export function userDesktopNoPass(data) {
  return request({
    url: 'api/userDesktop/no_pass',
    method: 'post',
    data
  })
}
// 查询公司列表
export function getDesktopDeptList() {
  return request({
    url: 'api/desktopChangeLog/getDept',
    method: 'get'
  })
}
// 查询用户自主切换日志
export function getDesktopChangeLog(params) {
  return request({
    url: 'api/desktopChangeLog/selectAll',
    method: 'get',
    params
  })
}

export default { add, edit, del, userDesktopPass, userDesktopNoPass, getDesktopChangeLog, getDesktopDeptList }
